package php4dvdTests;

import org.junit.Before;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.WebDriverWait;
import php4dvdPages.LoginPage;
import ru.esteru.selenium.factory.WebDriverFactory;

import java.util.concurrent.TimeUnit;


/**
 * @author Anna Alexeyenko
 *         Date: 1/19/13
 */
public class BasicActions {


    public WebDriver driver;
    public WebDriverWait wait;
    private final String loginUrl = "/php4dvd";
    public static final String baseUrl = "http://localhost/";


    @Before
    public void setUp() {
        driver = WebDriverFactory.getDriver(DesiredCapabilities.firefox());
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        wait = new WebDriverWait(driver, 10);
    }

    public LoginPage goToMainPage() {
        driver.get(baseUrl + loginUrl);
        return MyPageFactory.getPage(driver, LoginPage.class);

    }

}
